package com.huangj.fragments;

import android.os.Bundle;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.huangj.huangjlibrary.base.BaseFragment;
import com.huangj.pro2_h2pop.R;

import butterknife.BindView;


public class HomePicsFragment extends BaseFragment {

    @BindView(R.id.iv_home)
    ImageView imageView;

    public static HomePicsFragment getInstans(String url){
        HomePicsFragment homePicsFragment = new HomePicsFragment();
        Bundle bundle = new Bundle();
        bundle.putString("pic",url);
        homePicsFragment.setArguments(bundle);
        return  homePicsFragment;
    }
    @Override
    public int getContentId() {
        return R.layout.fragment_pics;
    }

    @Override
    protected void getDatas(Bundle bundle) {
        String url = bundle.getString("pic");
//        Log.d("print", "getDatas: "+url);
            Glide.with(getActivity()).load(url)
                    .diskCacheStrategy(DiskCacheStrategy.ALL)
                    .crossFade()
                    .into(imageView);
    }
}
